<?php
use common\service\StaticService;
use common\service\GlobalUrlService;
use backend\assets\AdminAsset;
use common\service\CommonService;
StaticService::includeAppJsStatic(GlobalUrlService::buildStaticUrl('/backend/goods/index.js'),AdminAsset::class);
?>

<div class="layui-card">
    <div class="layui-card-header">商品列表</div>
    <div class="layui-card-body">
        <div class="layui-form-item">
            <form method="get" action="<?php GlobalUrlService::buildAdminUrl('googs/index') ?>" class="layui-form">
                名称: 
                <div class="layui-inline">
                    <input type="text"  name="goods_name" class="layui-input" value="" />
                </div>
                商家状态:
                <div class="layui-inline">
                    <select class="oneclass" name="one_id" lay-filter="one">
                        <option value="0">请选择一级分类</option>
                        <?php foreach ($trees as $val):?>
                            <option value="<?=$val['id']?>"><?=$val['tree_name']?></option>
                        <?php endforeach;?>
                    </select>
                </div>
                <div class="layui-inline">
                    <select class="twoclass" name="two_id" lay-filter="two">
                        <option value="0">请选择二级分类</option>
                            <?php if(!empty($twodata)):?>
                            <?php foreach ($twodata as $val):?>
                                <option value="<?=$val['id']?>" <?php if ($two_id == $val['id']):?>selected<?php endif?> > <?= $val['tree_name']?> </option>
                            <?php endforeach;?>
                        <?php endif;?>
                    </select>
                </div>
                <div class="layui-inline">
                    <select class="threeclass" name="three_id">
                        <option value="0">请选择三级分类</option>
                        <?php if(!empty($threedata)):?>
                        <?php foreach ($threedata as $val):?>
                            <option value="<?= $val['id']?>" <?php if ($three_id == $val['id']):?>selected<?php endif?>><?= $val['tree_name']?></option>
                        <?php endforeach;?>
                        <?php endif;?>
                    </select>
                </div>
                <div class="layui-inline">
                    <button class="layui-btn" lay-submit lay-filter="search">搜索</button>
                </div>
            </form>
        </div>
        <div class="layui-form-item">
            <table id="list" lay-filter="operation"></table>
        </div>
    </div>
</div>

<script type="text/html" id="operation">
    <a class="layui-btn layui-btn-xs" lay-event="detail">查看</a>
</script>
<script type="text/html" id="lookup">
    <a class="layui-btn layui-btn-xs" lay-event="lookup">查看</a>
</script>
